function
	local taskname="userRegTask"
	log.info(taskname,"start")
    local netsend=""
	local uid=1
	local uartmsg ="UART"..uid.."_NEED_SEND"
	local outtime=10
	local rdata1,rdata2=nil,nil
	local cmd1={0x01,0x03,0x00,0x00,0x00,0x01,0x84,0x0A}
	local cmd2={0x01,0x04,0x00,0x00,0x00,0x01,0x31,0xCA}
	local data={}
    local count=60
    local num=0
    data.devid=misc.getImei()
	prouart.ProuartStopProReciveCache(1)	
	cmd1=usertool.ToolTableToHexStr(cmd1)
	cmd2=usertool.ToolTableToHexStr(cmd2)
	while true do
        netsend=""
        while true do 
            local res=nil
            res = prouart.ProuartGetReciveChaceAndDel(uid)
            if res == nil then 
                break
            end
            local ret = {}
            ret.devid=misc.getImei()
            ret.data=string.toHex(res)
            if pronet.PronetGetNetState(1)==1 then
                pronet.PronetInsertSendChache(1,json.encode(ret))
            end
            sys.wait(50)
        end
        if num==count then
            num=0
            data.volt = tostring(per.GetAdcGatherValByAdcId(3)/1000)
            log.info(taskname,"send cmd1")
            prouart.ProuartSetSendChace(uid,cmd1)
            sys.publish(uartmsg)
            log.info(taskname,"wait cmd1 rsp")
            sys.wait(1000)
            rdata1 = prouart.ProuartGetReciveChaceAndDel(uid)
            if rdata1 then
                log.info(taskname,"rdata1=",string.toHex(rdata1))
                data.open = tostring(string.byte(rdata1,5))
                netsend=rdata1
            else
                log.info(taskname,"no cmd1 rsp")
            end

            log.info(taskname,"send cmd2")
            prouart.ProuartSetSendChace(uid,cmd2)
            sys.publish(uartmsg)
            log.info(taskname,"wait cmd2 rsp")
            sys.wait(1000)
            rdata2 = prouart.ProuartGetReciveChaceAndDel(uid)
            if rdata2 then
                log.info(taskname,"rdata2=",string.toHex(rdata2))
                data.out = tostring(string.byte(rdata2,5))
                netsend=netsend..rdata2                
            else
                log.info(taskname,"no cmd2 rsp")
            end
            if netsend and netsend~="" then
                log.info(taskname,"need send netsend=",string.toHex(netsend))

                local netids={1,2,3,4,5,6,7,8}
                for index, value in ipairs(netids) do
                    local netmsg ="UART_DATA_TO_NET"..value
                    if pronet.PronetGetNetState(value) == 1 then
                        pronet.PronetInsertSendChache(value,json.encode(data))
                        sys.publish(netmsg)
                    end
                end
            end
        end
		num = num+1
		sys.wait(1000)
	end 
end